|
|
|
|
|
|
|
Identifying the need for other subsystems |
|
|
|
|
|
|
|
|
Deploying the Samsona Bank Teller System example |
|
|
|
|
|
|
|
|
Different Ways Subsystems Interact to Augment Application Behavior |
|
|
|
|
|
|
|
|
After reading the previous 19 chapters, you have realized by now that an application is at its best when its expected behavior is compartmentalized into subsystems. Subsystems, in turn, are compartmentalized into classes. Finally, classes are compartmentalized into methods, properties, and events. These various compartments communicate with one another through a common interface. At the subsystem level, the interfaces are represented by interface classes. At the class level, members communicate through argument lists accessed when methods, property methods, or events are invoked. |
|
|
|
|
|
|
|
|
The most critical communications, however, occur between subsystems. Subsystem interface classes are important because changes to them can cause a debugging and maintenance nightmare. It would be beneficial, then, to briefly discuss the major interfaces with respect to their intercommunications. |
|
|
|
|
|
|
|
|
Interfacing Between the Graphical User Interface and the Database Access Subsystems |
|
|
|
|
|
|
|
|
The Graphical User Interface Subsystem and the Database Access Subsystem typically don't need to communicate directly with one another. Data controls are an exception. Nonetheless, it's important to describe how information in the Graphical User Interface Subsystem is eventually channeled to or from the Database Access Subsystem. |
|
|
|
|
|
|
|
|
The forms themselves should not communicate directly with the database because the code that makes this communication happen tends to be duplicated or otherwise difficult to maintain. A healthy decoupling between the two subsystems is a result of using form controller classes, business or domain classes, and data access (or persistence) classes. |
|
|
|
|
|
|
|
|
Forms only invoke methods of their respective form controllers. Therefore, when you click a command button in the form, a method in the form controller is dedicated to processing the click event of that button. If you want to implement code to respond to the resizing of the form, the form delegates the response to a dedicated method in its controller. If the form's labels and text boxes need to be filled with data from the database, the form calls some method in its controller that is responsible for obtaining the data it needs. The story doesn't end here. |
|
|
|
|
|